﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConverterCore
{
    /// <summary>
    /// Atlas转换器。
    /// </summary>
    public class Converter_Atlas : IConvertable
    {
        string sample = @"
92	DF727A53	S40135C15000100BN0400LB00234	1258	离合器PI数据自学习(上升与下降)	未测试	--	--	2020-02-20 09:25:13	0071-1	CTL	Check
93	DF727A53	S40135C15000100BN0400LB00234	24	加油_加油量	已加油	L	OK	2020-02-20 09:25:13	0071-1	CTL	Check
94	DF727A53	S40135C15000100BN0400LB00234	25	校验软件版本号_变速器编号	S40135C15000100BN0400LB00234	--	OK	2020-02-20 09:25:13	0071-1	CTL	Check
94	DF727A53	S40135C15000100BN0400LB00234	25	校验软件版本号_变速器编号	S40135C15000100BN0400LB00234	--	OK	2020-02-20 09:25:13	0071-1	CTL	Check
95	DF727A53	S40135C15000100BN0400LB00234	26	校验软件版本号_软件版本号	SW:C.2.6	--	OK	2020-02-20 09:25:13	0071-1	CTL	Check
96	DF727A53	S40135C15000100BN0400LB00234	1257	校验软件版本号_软件件号	9220201-BN01        	--	OK	2020-02-20 09:25:13	0071-1	CTL	Check
97	DF727A53	S40135C15000100BN0400LB00234	27	I O 测试_拨叉1位置传感器	2520	mV	OK	2020-02-20 09:25:13	0071-1	CTL	Check";

        public List<PartInfo> Convert(ConvertSetup cs)
        {
            List<string> data = new List<string>();

            foreach (var line in sample.Split('\n'))
                if (line.Trim().Length > 0)
                    data.Add(line);

            //0.ID	1.Type	2.SN	3.Code	4.TestItem	5.TestValue	6.Unit	7.IsOK	8.TestTime	9.DeviceCode	10.Producer	11.Sources
            PartInfo pi = new PartInfo();
            foreach (var s in data)
            {
                var strs = s.Split('\t');
                pi.BasicInfo.Add("K1001", strs[1]);


            }

            return new List<PartInfo>();
        }
    }
}
